<template>
	<view class="publicWelfare">
		<view class="top">
			<view class="back">
				<image class="back-img" @click="back" src="../../../static/index/fanhui.png" mode=""></image>
				<text class="back-name">我的公益</text>
			</view>
			<view class="header">
				<view class="header-left">
					<image class="header-img" src="../../../static/mine/head.png" mode=""></image>
					<text>小明的幸福生活</text>
				</view>
				<view class="header-right" @click="jumpcertificate">
					<image class="zhengshu-img" src="../../../static/mine/public/zhengshu.png" mode=""></image>
					<text>证书</text>
				</view>
			</view>
		</view>
		<view class="detailed">
			<view class="detailed-top" @click="jumpDetails">
				<text>2021年度</text>
				<text>历年捐赠明细 ></text>
			</view>
			<view class="detailed-bottom">
				<view class="detailed-bottom-left">
					<view class="num">
						<text>3000</text>
						<text>积分</text>
					</view>
					<view class="text">
						捐赠总积分
					</view>
				</view>
				<view class="detailed-bottom-left">
					<view class="num">
						<text style="color: #FF0000 !important;">10</text>
						<text style="color: #FF0000 !important;">次</text>
					</view>
					<view class="text">
						捐赠次数
					</view>
				</view>
			</view>
		</view>
		<view class="follow">
			<view class="follow-box">
				<view class="follow-box-title">
					大家都在关注
				</view>
				<zjcScrollNav :platformList="platformList" @goClassiFication='goClassiFication'></zjcScrollNav>
			</view>
		</view>
		<view class="integral">
			<view class="integral-title">
				<text>本年度积分捐赠</text>
				<text>累计捐赠3000积分</text>
			</view>
			<view class="content">
				<scroll-view scroll-y="true" class="scrollx" :height="Height+'rpx'">
					<view class="content-box" v-for="(item,index) in integralList" :key="index">
						<view class="left">
							<text>{{item.day}}</text>
							<text>{{item.month}}月</text>
						</view>
						<view class="middle">
							<image src="../../../static/mine/public/banner2.png" mode=""></image>
						</view>
						<view class="right">
							<text>捐赠积分{{item.num}}积分</text>
							<text>空巢老人救助行动</text>
						</view>
					</view>
				</scroll-view>
			</view>
			<view class="btn" @click="checkMore">
				查看更多
			</view>
		</view>
	</view>
</template>

<script>
	import zjcScrollNav from '@/components/zjc-scroll-nav/zjc-scroll-nav.vue'
	export default {
		components: {
			zjcScrollNav
		},
		data() {
			return {
				Height:'446',
				integralList: [{
					month: '11',
					day: '19',
					num: "1000"
				}, {
					month: '11',
					day: '19',
					num: "1000"
				}, {
					month: '11',
					day: '19',
					num: "1000"
				}],
				platformList: [{
						img: require('../../../static/mine/public/banner2.png'),
						text: '空巢老人救助行动',
						num: '25410000人已捐'
					},
					{
						img: require('../../../static/mine/public/banner2.png'),
						text: '空巢老人救助行动',
						num: '25410000人已捐'
					},
					{
						img: require('../../../static/mine/public/banner2.png'),
						text: '空巢老人救助行动',
						num: '25410000人已捐'
					},
					{
						img: require('../../../static/mine/public/banner2.png'),
						text: '空巢老人救助行动',
						num: '25410000人已捐'
					},
					{
						img: require('../../../static/mine/public/banner2.png'),
						text: '空巢老人救助行动',
						num: '25410000人已捐'
					}
				],

			}
		},
		mounted() {
			this.checkMore()
		},
		methods: {
			jumpcertificate(){
				uni.navigateTo({
					url:'./mycertificate'
				})
			},
			jumpDetails(){
				uni.navigateTo({
					url:'./donationDetails'
				})
			},
			
			back() {
				uni.navigateBack()
			},
			goClassiFication(e){
				console.log(e,11111);
			},
			//查看更多
			checkMore(){
				
				const query = uni.createSelectorQuery().in(this);
					query.select('.scrollx').boundingClientRect(data => {
						
						this.Height = data.height+200
					}).exec();
					console.log(this.Height,5555)

				
				
				// var query=uni.createSelectorQuery()
				
				// query.in(this).select(".scrollx").boundingClientRect(scrollx=>{
				
				// console.log(scrollx,7777777777)
				
				// })
			}
		}
	}
</script>

<style lang="less" scoped>
	.content-box {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding-bottom: 24rpx;
		border-bottom: 1px solid #efefef;
		margin-bottom: 30rpx;

		.right {
			display: flex;
			flex-direction: column;
			padding-bottom: 24rpx;
			margin-right: 10rpx;

			text:first-child {
				font-size: 36rpx;
				font-family: Source Han Sans CN;
				font-weight: bold;
				color: #333333;
			}

			text:last-child {
				font-size: 28rpx;
				font-family: Source Han Sans CN;
				font-weight: 500;
				color: #999999;
			}
		}

		.middle {
			width: 236rpx;
			height: 112rpx;
			margin: 0 20rpx;

			image {
				width: 100%;
				height: 100%;
			}
		}

		.left {
			display: flex;
			flex-direction: column;
			padding-bottom: 24rpx;
			margin-left: 10rpx;

			text:first-child {
				font-size: 36rpx;
				font-family: Source Han Sans CN;
				font-weight: bold;
				color: #333333;
			}

			text:last-child {
				font-size: 28rpx;
				font-family: Source Han Sans CN;
				font-weight: 500;
				color: #999999;
			}
		}
	}

	.integral {
		margin: 0 5%;
		width: 90%;
		height: auto;
		background: #FFFFFF;
		opacity: 1;
		border-radius: 20rpx;
		position: relative;

		.content {
			width: 100%;
			height: auto;
			overflow: hidden;
		}

		.btn {
			position: absolute;
			bottom: 0;
			left: 0;
			height: 84rpx;
			width: 100%;
			border-top: 2rpx solid #F2F2F2;
			line-height: 84rpx;
			text-align: center;
			font-size: 32rpx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #999999;
			background-color: #FFFFFF;
			border-radius: 0 0 20rpx 20rpx;
		}

		.integral-title {
			padding: 40rpx 32rpx 20rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;

			text:first-child {
				font-size: 32rpx;
				font-family: Source Han Sans CN;
				font-weight: bold;
				color: #333333;
			}

			text:last-child {
				font-size: 24rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				color: #999999;
			}
		}
	}

	/deep/.card_swiper {
		margin-left: 22rpx;
	}

	/deep/.item {
		width: 256rpx !important;
		height: 100% !important;
	}

	/deep/.item_img {
		width: 256rpx !important;
		height: 120rpx !important;
		border-radius: 0 !important;
	}

	.follow {
		padding-top: 700rpx;
		padding-bottom: 60rpx;
		width: 100%;
		height: auto;
		background-color: #EFEFEF;

		.follow-box {
			width: 100%;
			height: 338rpx;
			background: #FFFFFF;
			opacity: 1;
			border-radius: 20rpx;

			.follow-box-title {
				font-size: 32rpx;
				font-family: Source Han Sans CN;
				font-weight: bold;
				color: #333333;
				padding: 30rpx 0 0rpx 40rpx;
			}
		}
	}

	.publicWelfare {
		position: relative;
		padding-bottom: 40rpx;
	}

	.detailed {
		padding: 30rpx;
		width: 80%;
		height: 260rpx;
		background: #FFFFFF;
		opacity: 1;
		border-radius: 20rpx;
		position: absolute;
		top: 362rpx;
		left: 0;
		right: 0;
		margin: auto;

		.detailed-bottom {
			margin-top: 28rpx;
			display: flex;
			padding: 0 30rpx;
			justify-content: space-between;

			.detailed-bottom-left {
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;

				.num {
					text:first-child {
						font-family: Source Han Sans CN;
						font-weight: bold;
						color: #FF7200;
						font-size: 40rpx;
					}

					text:last-child {
						font-family: Source Han Sans CN;
						font-weight: 500;
						color: #FF7200;
						font-size: 32rpx;
					}
				}

				.text {
					margin-top: 13rpx;
					font-size: 28rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #999999;
				}
			}
		}

		.detailed-top {
			display: flex;
			justify-content: space-between;
			line-height: 70rpx;
			height: 70rpx;
			border-bottom: 2rpx solid #F2F2F2;

			text:first-child {
				font-size: 36rpx;
				font-family: Source Han Sans CN;
				font-weight: 500;
				color: #333333;
			}

			text:last-child {
				font-size: 28rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				color: #FF7200;
			}
		}
	}

	.top {
		width: 100%;
		height: 476rpx;
		background: linear-gradient(146deg, #FF7200 0%, #F5BD91 100%);
		opacity: 1;
		position: fixed;
		top: 0;
		left: 0;
	}

	.header {
		display: flex;
		justify-content: space-between;
		padding: 60rpx 40rpx;

		.header-right {
			display: flex;
			flex-direction: column;
			align-items: center;

			.zhengshu-img {
				width: 70rpx;
				height: 70rpx;
			}

			text {
				font-size: 32rpx;
				font-family: Source Han Sans CN;
				font-weight: bold;
				color: #FFFFFF;
			}
		}

		.header-left {
			display: flex;
			align-items: center;

			.header-img {
				width: 120rpx;
				height: 120rpx;
				border-radius: 50%;
			}

			text {
				font-size: 32rpx;
				font-family: Source Han Sans CN;
				font-weight: bold;
				color: #FFFFFF;
				margin-left: 20rpx;
			}
		}
	}

	.back {
		padding-top: 60rpx;
		padding-left: 30rpx;
		width: 100%;
		display: flex;
		align-self: center;

		.back-img {
			width: 40rpx;
			height: 40rpx;
			margin-top: 10rpx;
		}

		.back-name {
			font-size: 18px;
			line-height: 31px;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #ffffff;
			margin-right: 28rpx;
		}
	}
</style>
